home *** CD-ROM | disk | FTP | other *** search
- //--------------------------------------------------------------
- //
- // IReport.wfm - Invoice Request form for
- // the Mugs Sample Application
- //
- // This form provides a spinbox for selecting a invoice
- // number. The readModal() method is overwritten to
- // set range properties on the spinbox prior to opening
- // the form as a dialog.
- //
- // The DMCONNECT datamodule provides a database connection
- // so this form can create temporary queries using the
- // Invoice table. The temporary queries return the minimum
- // and maximum Invoice values.
- //
- // Dependencies: DMCONNECT.DMD
- // Invoice table
- //
- // Visual dBASE Samples Group
- //
- // $Revision: 1.3 $
- //
- // Copyright (c) 1997, Borland International, Inc.
- // All rights reserved.
- //
- //---------------------------------------------------------------
-
- SET TALK OFF
- ** END HEADER -- do not remove this line
- //
- // Generated on 10/23/97
- //
- parameter bModal
- local f
- f = new IReportForm()
- if (bModal)
- f.mdi = false // ensure not MDI
- f.readModal()
- else
- f.open()
- endif
-
- class IReportForm of FORM
- with (this)
- onOpen = class::FORM_ONOPEN
- readModal = class::FORM_READMODAL
- scaleFontSize = 8
- scaleFontBold = false
- height = 7.0455
- left = 46.5
- top = 0
- width = 42
- text = "Invoice Report"
- autoCenter = true
- endwith
-
-
- this.DMCONNECT = new DATAMODREF()
- this.DMCONNECT.parent = this
- with (this.DMCONNECT)
- filename = "connect.dmd"
- dataModClass = "ConnectDataModule"
- share = 0
- active = true
- left = 0
- top = 0
- endwith
-
-
- this.SPININVOICE = new SPINBOX(this)
- with (this.SPININVOICE)
- height = 1
- left = 24
- top = 1.8947
- width = 12
- metric = 0
- colorHighLight = ""
- rangeMax = 100
- rangeMin = 1
- fontName = "MS Sans Serif"
- fontSize = 8
- value = 1
- borderStyle = 7
- endwith
-
-
- this.TEXT1 = new TEXT(this)
- with (this.TEXT1)
- height = 1
- left = 6
- top = 1.8947
- width = 16
- metric = 0
- colorNormal = "BtnText"
- alignVertical = 1
- fontName = "MS Sans Serif"
- fontSize = 8
- text = "Invoice to print:"
- endwith
-
-
- this.BUTTONOK = new PUSHBUTTON(this)
- with (this.BUTTONOK)
- onClick = {;this.form.OK := true;return this.form.close()}
- height = 1.2105
- left = 7
- top = 4.2632
- width = 12
- text = "OK"
- metric = 0
- fontName = "MS Sans Serif"
- fontSize = 8
- group = true
- colorNormal = "BtnText/BtnFace"
- value = false
- endwith
-
-
- this.BUTTONCANCEL = new PUSHBUTTON(this)
- with (this.BUTTONCANCEL)
- onClick = {||this.form.close()}
- height = 1.2105
- left = 22
- top = 4.2632
- width = 12
- text = "Cancel"
- metric = 0
- fontName = "MS Sans Serif"
- fontSize = 8
- group = true
- colorNormal = "BtnText/BtnFace"
- value = false
- endwith
-
-
- // {Linked Method} form.onOpen
- function form_onOpen
- this.OK = false // create OK property
- return true
-
- // {Linked Method} form.readModal
- function form_readModal
- local q, nMax, nMin
- q = new Query()
- nMin = 0
- nMax = 0
- with (q)
- database := this.dmConnect.ref.dbMugs
- sql := 'select max(invoice."Invoice ID") from "invoice.dbf" invoice'
- active := true
- endwith
- nMax := q.rowset.fields[1].value
- q.active := false
- with (q)
- database := this.dmConnect.ref.dbMugs
- sql := 'select min(invoice."Invoice ID") from "invoice.dbf" invoice'
- active := true
- endwith
- nMin := q.rowset.fields[1].value
- q.active := false
- with ( this.spinInvoice )
- rangeMin := nMin
- rangeMax := nMax
- rangeRequired := true
- endwith
- return IREPORTFORM::readModal()
- endclass
-